package com.mytest.service;

import com.mytest.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.inject.Inject;
import javax.inject.Named;

/*
* @Repository
* @Name 不是spring原生，但spring支持
* */
@Service
public class ServiceA {

    /*
    * @Inject和@Resource都支持，都不是spring原生的
    * */
    @Autowired
    Student student;

    public void sayHello(){
        System.out.println("hello my brother");
        //使用springaop后并没有生成代理类，getclass还是com.mytest.service.ServiceA
        System.out.println(this.getClass().getName());
    }

    public void print(){

        System.out.println(student);
    }
}
